package com.qilin.hscs.hm.dao;


import com.qilin.hscs.hm.pojo.Room;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RoomRepository extends JpaRepository<Room, Integer> {

      @Query("select r.floor from Room r group by r.floor")
      List <String> findAllFloor();

      @Query("select r  from Room r group by r.floor")
      List <Room> findDistinctRooms();

}
